Page({
	data:{ //页面初始化数据
		name: '张三',
		friends: [
			{name:'张三', age:20, tel:"13333333333", },
			{name:'历史', age:22, tel:"13444444444", },
			{name:'王五', age:21, tel:"15555555555", },
		],
	},
	dahai(e){ //跳转到大海影视的列表页面
		wx.navigateTo({
		  url: '/pages/dahai/index',
		})
	},
	setUserMessage: function(e){
		this.setData({ //动态设置页面数据
			userName: '张三丰',
			userAge: 80,
		})
	},
	getUserAge(e){
		let age=this.data.userAge //通过this.data来获取页面数据
		let jiouxing=age%2==0?'偶数':'奇数'
		this.setData({jiouxing}) 
	},
	ageUp1(e){
		let userAge=this.data.userAge??0 //若年龄是null，就取默认值0
		++userAge
		this.setData({userAge})
	},
	getFriend(e){
		let index=e.currentTarget.dataset.friendIndex //获取点击朋友的索引号
		this.setData({index})
	},
})